package com.rover.system.entity;

import java.io.Serializable;

import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import org.codehaus.jackson.annotate.JsonIgnore;

import com.grid.ViewField;

/**
 * 表单字段
 * 
 */
@Entity
@Table(name = "S_FormTableField")
public class FormTableField  implements Serializable{

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	@ViewField
	private Integer fieldId;
	private FormTableInfo formTableInfo;
	
	
	@ViewField(header = "显示名", width = 100)
	private String fieldDisplayName;
	@ViewField(header = "列名", width = 100)
	private String fieldName;
	@ViewField(header = "字段类型", width = 80)
	private String fieldType;
	@ViewField(header = "小数位", width = 80)
	private Integer decimalPlaces;
    @ViewField(header = "字段长度", width = 80)
    private Integer fieldLength;
	@ViewField(header = "唯一字段", width =80)
	private Integer isForeignKey;
	@ViewField(header = "代码表", width = 80)
	private String codeName;

    @ViewField(header = "控件类型", width = 80)
    private String controlType;
	@ViewField(header = "必填", width = 80)
	private Integer mustFill;
    @ViewField(header = "列表显", width = 80)
    private Integer dispInGrid;
    @ViewField(header = "表单显示", width = 80)
	private Integer dispInFrom;
    //显示宽度    单倍宽 双倍宽
    @ViewField(header = "显示宽度", width = 80)
	private Integer colspan;
    @ViewField(header = "是否查询", width = 80)
    private Integer dispQuery;
    @ViewField(header = "显示顺序", width = 80)
    private Integer sortSQ;
	@Id
    @GeneratedValue(strategy=GenerationType.IDENTITY) 
	public Integer getFieldId() {
		return fieldId;
	}
	public void setFieldId(Integer fieldId) {
		this.fieldId = fieldId;
	}
	
	@ManyToOne(cascade= CascadeType.DETACH,fetch=FetchType.EAGER)
	@JoinColumn(name = "tableID")
    @JsonIgnore
	public FormTableInfo getFormTableInfo() {
		return formTableInfo;
	}
	public void setFormTableInfo(FormTableInfo formTableInfo) {
		this.formTableInfo = formTableInfo;
	}

    public String getFieldDisplayName() {
        return fieldDisplayName;
    }

    public void setFieldDisplayName(String fieldDisplayName) {
        this.fieldDisplayName = fieldDisplayName;
    }

    public String getFieldName() {
        return fieldName;
    }

    public void setFieldName(String fieldName) {
        this.fieldName = fieldName;
    }

    public String getFieldType() {
        return fieldType;
    }

    public void setFieldType(String fieldType) {
        this.fieldType = fieldType;
    }

    public Integer getDecimalPlaces() {
        return decimalPlaces;
    }

    public void setDecimalPlaces(Integer decimalPlaces) {
        this.decimalPlaces = decimalPlaces;
    }

    public Integer getFieldLength() {
        return fieldLength;
    }

    public void setFieldLength(Integer fieldLength) {
        this.fieldLength = fieldLength;
    }

    public Integer getIsForeignKey() {
        return isForeignKey;
    }

    public void setIsForeignKey(Integer isForeignKey) {
        this.isForeignKey = isForeignKey;
    }

    public String getCodeName() {
        return codeName;
    }

    public void setCodeName(String codeName) {
        this.codeName = codeName;
    }

    public String getControlType() {
        return controlType;
    }

    public void setControlType(String controlType) {
        this.controlType = controlType;
    }

    public Integer getMustFill() {
        return mustFill;
    }

    public void setMustFill(Integer mustFill) {
        this.mustFill = mustFill;
    }

    public Integer getDispInGrid() {
        return dispInGrid;
    }

    public void setDispInGrid(Integer dispInGrid) {
        this.dispInGrid = dispInGrid;
    }

    public Integer getDispInFrom() {
        return dispInFrom;
    }

    public void setDispInFrom(Integer dispInFrom) {
        this.dispInFrom = dispInFrom;
    }

    public Integer getColspan() {
        return colspan;
    }

    public void setColspan(Integer colspan) {
        this.colspan = colspan;
    }

    public Integer getDispQuery() {
        return dispQuery;
    }

    public void setDispQuery(Integer dispQuery) {
        this.dispQuery = dispQuery;
    }

    public Integer getSortSQ() {
        return sortSQ;
    }

    public void setSortSQ(Integer sortSQ) {
        this.sortSQ = sortSQ;
    }
}
